package com.wwz.frame.filter;


import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**  
* @Description   过滤器实现方式二 实现Filter 接口   FilterConfiguration中加入过滤链
* @Author wwz
* @Date 2019/08/26
* @Param   
* @Return   
*/ 
@Slf4j
public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig arg0) throws ServletException {
        log.info("初始化MyFilter");
    }

    @Override
    public void doFilter(ServletRequest srequest, ServletResponse sresponse,
                         FilterChain filterChain)
            throws IOException, ServletException {
        // TODO Auto-generated method stub
        log.info("MyFilter 请求处理");
        HttpServletRequest request = (HttpServletRequest) srequest;
        filterChain.doFilter(srequest, sresponse);
    }

}
